/**
 * 全局  
 */
export default {

  state: {
    //暂时不需要
    screenHeight:0,
    screenWidth:0,
    windowHeight:0,
    windowWidth:0,
  },

  mutations: {

    setScreenHeight(state, value) {
      state.screenHeight = value;
    },
    
    setScreenWidth(state, value) {
      state.screenWidth = value;
    },
    
    setWindowHeight(state, value) {
      state.windowHeight = value;
    },

    setWindowWidth(state, value) {
      state.windowWidth = value;
    }

  },

  actions: {
    //动态监听高度变化
    handleWindowResize({state,commit},data){
      commit("setScreenHeight", data.screenHeight);
      commit("setScreenWidth", data.screenWidth);
      commit("setWindowHeight", data.windowHeight);
      commit("setWindowWidth", data.windowWidth);
    },
    //测试使用
    handleScreenHeight({state,commit},value){
      commit("setScreenHeight", value);
    }
  }
}
